package com.xb.loan.util.qrtz.common.store;

/**
 * 
 * sql语句模板
 */
public interface SqlTemplate {
    String TABLE_PREFIX_SUBST = "{0}";
    /**
     * 插入任务实体对象
     */
	String insertTaskEntirySql = "INSERT INTO "+TABLE_PREFIX_SUBST+"task "
			+ "(id, create_time,fire_time , task_type, cron, task_status,class,task_data,game_id,issue_id,task_desc) VALUES (?, ?, ?,?,?,?,?,?,?,?,?)";
	/**
	 * 更新任务实体对象
	 */
	String updateTaskEntitySql = "UPDATE "+TABLE_PREFIX_SUBST+"task SET complete_time =?  , task_status = ?  ,VERSION=VERSION+1 WHERE id = ?";
	/**
	 * 更新任务实体对象（不修改任务节点Ip）
	 */
	String updateTaskEntityWithoutHostSql = "UPDATE "+TABLE_PREFIX_SUBST+"task SET start_time =?  , task_status = ?,VERSION=VERSION+1,host=? WHERE id = ?" ;
    /**
     * 获取单个任务实体对象
     */
	String selectTaskEntityByIdSql = "select * from "+TABLE_PREFIX_SUBST+"task  WHERE id = ?";
	/**
	 * 获取没有触发的任务实体对象列表
	 */
	String selectMisFireTaskEntitySql = "select * from "+TABLE_PREFIX_SUBST+"task  WHERE fire_time < ? and task_status=? and task_type=? ";
	
	
	/**
     * 更新任务实体对象cron
     */
    String updateTaskEntityForCronAndDataSql = "UPDATE "+TABLE_PREFIX_SUBST+"task SET  task_status = ?,cron=? , task_data=?  WHERE id = ?";
    
    
    
    /**
     * 更新任务实体对象
     */
    String updateTaskEntiryFordelayTimeAndDataSql = "UPDATE "+TABLE_PREFIX_SUBST+"task SET  task_status = ? , fire_time=?,task_data=? WHERE id = ?";

}